home *** CD-ROM | disk | FTP | other *** search
- Path: erich.triumf.ca!bennett
- From: bennett@erich.triumf.ca (P.Bennett)
- Newsgroups: comp.lang.c
- Subject: Re: How do I write gets() function that checks for boundaries?
- Date: 8 Mar 1996 07:26 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <8MAR199607260317@erich.triumf.ca>
- References: <313FDB9F.7455@cyberus.ca>
- NNTP-Posting-Host: erich.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <313FDB9F.7455@cyberus.ca>, MC <mcardinal@cyberus.ca> writes...
- >I want to write my own gets() function that will check string size so that it doesn't accept more
- >characters than my declared string variable. Any ideas?
-
- don't bother - a suitable function already exists.
-
- use fgets().
- (but beware that it leaves the '\n' on the input.)
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
- or: ftp://ftp-i2.informatik.rwth-aachen.de/pub/arnd/GPS/peter/index.html
-
-